const REGEX = {
    TRID : /TRID: '(\d+)'/m,
    RX_PACKAGES : /^rx_packets=(\d*)/,
    TX_PACKAGES : /^tx_packets=(\d*)/,
    RX_BYTES : /^rx_bytes=(\d*)/,
    TX_BYTES : /^tx_bytes=(\d*)/,
    CONN_TIME: /^connected_time=(\d*)/,
    SIGNAL:/signal=(-*\d*)/,
    
    LINESPLITE : /[\r\n]/gm
}

const regTest = "[/dev/cdc-wdm0] Session not closed:\r\n"+
"           TRID: '3'";


//console.log("match",regTest.match(REGEX.TRID));
//console.log("search",regTest.match(REGEX.LINESPLITE));
const dataArr = regTest.split(REGEX.LINESPLITE);
for (const key in dataArr) {
    if (Object.hasOwnProperty.call(dataArr, key)) {
        const element = dataArr[key];
        if(element.search(REGEX.TRID) > -1){
            console.log(element);
        }

    }
}
console.log("split",regTest.split(REGEX.LINESPLITE));

//console.log("exec",REGEX.TRID.exec(regTest));
//console.log("test",REGEX.TRID.test(regTest));